<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>目录示例</title>
    <style>
      body {
        font-family: Arial, sans-serif;
        line-height: 1.8;
      }

      .toc {
        max-width: 600px;
        margin: 0 auto;
      }

      .toc h1 {
        font-size: 20px;
        margin-bottom: 10px;
      }

      .toc ol {
        list-style: none;
        padding: 0;
      }

      .toc li {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 10px;
      }

      .toc li::before {
        content: none;
      }

      .dots {
        flex-grow: 1;
        border-bottom: 1px dotted #000;
        margin: 0 10px;
      }

      .page-number {
        white-space: nowrap;
      }
    </style>
  </head>
  <body>
    <div class="toc">
      <h1>目录</h1>
      <ol>
        <li>
          <span>一、西游记</span>
          <span class="dots"></span>
          <span class="page-number">1</span>
        </li>
        <li>
          <span>（一）石猴出世</span>
          <span class="dots"></span>
          <span class="page-number">1</span>
        </li>
        <li>
          <span>（二）三打白骨精</span>
          <span class="dots"></span>
          <span class="page-number">2</span>
        </li>
        <li>
          <span>二、红楼梦</span>
          <span class="dots"></span>
          <span class="page-number">5</span>
        </li>
        <li>
          <span>（一）黛玉葬花</span>
          <span class="dots"></span>
          <span class="page-number">5</span>
        </li>
        <li>
          <span>（二）香菱学诗</span>
          <span class="dots"></span>
          <span class="page-number">10</span>
        </li>
        <li>
          <span>三、三国演义</span>
          <span class="dots"></span>
          <span class="page-number">24</span>
        </li>
        <li>
          <span>（一）三顾茅庐</span>
          <span class="dots"></span>
          <span class="page-number">24</span>
        </li>
      </ol>
    </div>
  </body>
</html>
